Skip to content

Conversation

@Decel
Copy link
Contributor

@Decel Decel commented Mar 31, 2023

Should fix #16899

*/
final def mayHaveCommonChild(that: ClassSymbol)(using Context): Boolean =
!this.is(Final) && !that.is(Final) && (this.is(Trait) || that.is(Trait)) ||
!this.isOneOf(FinalOrSealed) && !that.isOneOf(FinalOrSealed) && (this.is(Trait) || that.is(Trait)) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not valid, because the following hierarchy is allowed:

sealed trait A
sealed trait B
class C extends A with B

@Decel Decel closed this May 7, 2023
@Decel Decel deleted the i16899 branch May 7, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong warning on matching union types

2 participants